//
//  ChuShouChoseTypeHeaderView.m
//  EnterpriseEdition
//
//  Created by ypj on 2021/10/10.
//

#import "ChuShouChoseTypeHeaderView.h"

@implementation ChuShouChoseTypeHeaderView
- (void)awakeFromNib{
   [super awakeFromNib];
}
+ (instancetype)shareInstance {
    return [[NSBundle mainBundle] loadNibNamed:kClsID(ChuShouChoseTypeHeaderView) owner:nil options:nil][0];
}

- (IBAction)noButtonClick:(UIButton *)sender {
    if (sender.selected==YES) {
         self.sureButton.selected=YES;
        [self.sureButton setImage:[UIImage imageNamed:@"big_selectIcon"] forState:UIControlStateNormal];
    } else {
         self.sureButton.selected=NO;
       
        [self.sureButton setImage:[UIImage imageNamed:@"big_unSelect_icon"] forState:UIControlStateNormal];
        [self.noButton setImage:[UIImage imageNamed:@"big_selectIcon"] forState:UIControlStateNormal];
    }
     self.choseType=@"2";
     self.ToSendValue(self.choseType);
     [self refreshShopGetOrderAutoFlag];
}

- (IBAction)sureButtonClick:(UIButton *)sender {
    if (sender.selected==YES){
         self.noButton.selected=YES;
        [self.noButton setImage:[UIImage imageNamed:@"big_selectIcon"] forState:UIControlStateNormal];

    } else {
         self.noButton.selected=NO;
        [self.noButton setImage:[UIImage imageNamed:@"big_unSelect_icon"] forState:UIControlStateNormal];
        [self.sureButton setImage:[UIImage imageNamed:@"big_selectIcon"] forState:UIControlStateNormal];
    }
     self.choseType=@"1";
     self.ToSendValue(self.choseType);
    [self refreshShopGetOrderAutoFlag];
}
-(void)refreshShopGetOrderAutoFlag{
    if ([self.choseType isEqualToString:@"1"]) {
     
        [self.noButton setImage:Image(@"big_unSelect_icon") forState:UIControlStateNormal];
        [self.sureButton setImage:Image(@"big_selectIcon") forState:UIControlStateNormal];
        self.noButton.selected=NO;
    } else {
        self.sureButton.selected=NO;
        [self.sureButton setImage:Image(@"big_unSelect_icon") forState:UIControlStateNormal];
        [self.noButton setImage:Image(@"big_selectIcon") forState:UIControlStateNormal];
    }
}
@end
